<html>
  <head>
    <title>Youtube with VideoJS player</title>
    <link href="video.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="video.js"></script>
    <script type="text/javascript" src="ytapi.js"></script>
  </head>
  <body>
<h2>Youtube with VideoJS player</h2>
Sample videos: 
<a href="?vid=XSGBVzeBUbk">Big Buck Bunny</a>
<a href="?vid=rO0yXC0oyIA">Sintel</a>
<a href="?vid=hzixp8s4pyg">Ice Age 4</a>
<a href="?vid=9bZkp7q19f0">PSY</a>
<br>
<br>
<video id="YTAPI" 
  class="video-js vjs-default-skin" 
  controls
  preload="auto" 
  width="640"
  height="360"
  autoplay="autoplay"
  data-setup='{"techOrder":["youtube"], "forceSSL":true, "ytcontrols":false, "src":"https://www.youtube.com/watch?v=<? 
 if(isset($_GET['vid'])) $vid=$_GET['vid']; 
 if(!preg_match('#^[a-zA-Z0-9\-\_]{11}$#',$vid)) $vid='A6XUVjK9W4o';
 echo $vid;
?>"}'>
</video>
<br>
  <a href="/dev/">Code for developers</a>
 </body>
</html>
